package com.yuye.cloud.common.feign.fallback;

import com.yuye.cloud.common.feign.HotspotDiscoveryService;
import com.yuye.cloud.common.model.Result;
import com.yuye.cloud.common.model.CacheEntity;
import com.yuye.cloud.common.model.ResultUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * userService降级工场
 *
 * @author xgf
 */
@Slf4j
public class HotspotDiscoveryServiceFallbackFactory implements FallbackFactory<HotspotDiscoveryService> {
    @Override
    public HotspotDiscoveryService create(Throwable throwable) {
        return new HotspotDiscoveryService() {

			@Override
			public Result hotspotSubmit(CacheEntity cacheEntity) {
				 log.error("上传redis 查询记录异常:{}", cacheEntity, throwable);
	                return ResultUtil.success();
			}
        };
    }
}
